package com.xuanwu.ai.flow.execute;

import com.xuanwu.ai.flow.dto.CommonContextDTO;
import com.yomahub.liteflow.core.FlowExecutor;
import com.yomahub.liteflow.flow.LiteflowResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
@Slf4j
public class ChainExecute implements CommandLineRunner {

    @Resource
    private FlowExecutor flowExecutor;

    @Value("${ai.test}")
    private String test;

    @Override
    public void run(String... args) throws Exception {
          log.info("ai.test:{}", test);
//        CommonContextDTO commonContext = new CommonContextDTO();
//        commonContext.setUrl("http://123.jpg");
//        LiteflowResponse response = flowExecutor.execute2Resp("chain1", "", commonContext);
    }
}
